function e(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

Object.defineProperty(exports, "__esModule", {
    value: !0
});

var t = Object.assign || function(e) {
    for (var t = 1; t < arguments.length; t++) {
        var r = arguments[t];
        for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
    }
    return e;
};

exports.sendMobileCode = function(e) {
    return new Promise(function(t, n) {
        r.default.users.sendcode({
            source: "weApp",
            mobile: e
        }).then(function(e) {
            e.code === o.default.SUCCESS && e.data.issend ? t() : n();
        });
    });
}, exports.resolverWxMobile = function(e, o) {
    return new Promise(function(i, s) {
        /getPhoneNumber:fail/.test(e.errMsg) ? s() : (wx.showLoading({
            title: "获取中...",
            mask: !0
        }), n.default.getLoginCodeOrSessionkey().then(function(n) {
            r.default.weapp.getUserMobile({
                data: t({}, n, {
                    iv: e.iv,
                    encryptedData: e.encryptedData,
                    app: o
                }),
                complete: wx.hideLoading
            }).then(i, s);
        }));
    });
};

var r = e(require("../../utils/api")), n = e(require("../../utils/user")), o = e(require("../../utils/api-code"));